public class Decorator {
    public static void main(String[] args) {
        Coffee coffee = new Espresso();

        coffee = new Mocha(coffee);
        coffee = new Mocha(coffee);
        coffee = new Whip(coffee);

        System.out.println(coffee.cost()); // 3.6(2.5 + 0.5 + 0.5 + 0.1)
    }
}
